package com.youkeyi.ddy.cloud.common.api.application.business.crm.supplier;

import com.youkeyi.ddy.cloud.common.api.application.business.crm.supplier.dto.BusinessSupplierListCloudDto;
import com.youkeyi.ddy.cloud.common.api.application.business.crm.supplier.param.BusinessSupplierCreateCloudParam;
import com.youkeyi.ddy.cloud.common.api.application.business.crm.supplier.param.BusinessSupplierDeleteCloudParam;
import com.youkeyi.ddy.cloud.common.api.application.business.crm.supplier.param.BusinessSupplierListCloudParam;
import com.youkeyi.ddy.cloud.common.api.application.business.crm.supplier.param.BusinessSupplierUpdateCloudParam;
import com.youkeyi.ddy.cloud.common.response.ResponseContent;
import io.swagger.annotations.*;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * 系统合作商
 *
 * @author  liuxiawang
 * @Date 5/24/22 10:36 PM
 * @Location shenzhen.china
 */
@Api(tags = {"【BUSINESS】Supplier Management"})
@RestController
@FeignClient(value = "YOUKEYI-DDY-CLOUD-APPLICATION-BUSINESS", fallback = BusinessSupplierCloudServiceFallback.class)
@RequestMapping("/business/supplier")
public interface BusinessSupplierCloudService {

    // 查询合作商列表
    @ApiOperation(value = "Query Business Supplier List", authorizations = {@Authorization("com.youkeyi.ddy.cloud.common.api.application.business.crm.supplier.BusinessSupplierCloudService.list")})
    @ApiResponse(code = 200, message = "data Property in Response Body", response = BusinessSupplierListCloudDto.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "param", paramType = "query", value = "Param of Query Business Supplier List", dataType = "BusinessSupplierListCloudParam", dataTypeClass = BusinessSupplierListCloudParam.class),
    })
    @GetMapping
    public abstract BusinessSupplierListCloudDto list(BusinessSupplierListCloudParam param);

    // 创建合作商
    @ApiOperation(value = "Create Business Supplier", authorizations = {@Authorization("com.youkeyi.ddy.cloud.common.api.application.business.crm.supplier.BusinessSupplierCloudService.create")})
    @ApiResponse(code = 200, message = "data Property in Response Body", response = ResponseContent.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "param", paramType = "body", value = "Param of Create Business Supplier", dataType = "BusinessSupplierCreateCloudParam", dataTypeClass = BusinessSupplierCreateCloudParam.class),
    })
    @PostMapping("/create")
    public abstract ResponseContent create(@RequestBody BusinessSupplierCreateCloudParam param);


    // 编辑合作商
    @ApiOperation(value = "Update Business Supplier", authorizations = {@Authorization("com.youkeyi.ddy.cloud.common.api.application.business.crm.supplier.BusinessSupplierCloudService.update")})
    @ApiResponse(code = 200, message = "data Property in Response Body", response = ResponseContent.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "param", paramType = "body", value = "Param of Update Business Supplier", dataType = "BusinessSupplierUpdateCloudParam", dataTypeClass = BusinessSupplierUpdateCloudParam.class),
    })
    @PatchMapping("update")
    public abstract ResponseContent update(@RequestBody BusinessSupplierUpdateCloudParam param);


    // 删除合作商
    @ApiOperation(value = "Delete Business Supplier", authorizations = {@Authorization("com.youkeyi.ddy.cloud.common.api.application.business.crm.supplier.BusinessSupplierCloudService.delete")})
    @ApiResponse(code = 200, message = "data Property in Response Body", response = ResponseContent.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "param", paramType = "query", value = "Param of Delete Business Supplier", dataType = "BusinessSupplierDeleteCloudParam", dataTypeClass = BusinessSupplierDeleteCloudParam.class),
    })
    @DeleteMapping("/delete")
    public abstract ResponseContent delete(BusinessSupplierDeleteCloudParam param);

}
